/*
 * @# DataUtils.java 2011-11-7 下午04:46:16
 * 
 * Copyright (C) 2010 - 2011 广州羿安信息科技有限公司
 * Guangzhou ianswer information technology co. ltd.
 * 
 * All rights reserved!
 */
package com.ianswer.experiments.redis;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author alvin hwang
 */
public final class DataUtils {

	private static ApplicationContext ctx = new ClassPathXmlApplicationContext("classpath*:/applicationContext.xml");

	public static <T> T getBean(String beanName, Class<T> clazz) {
		if (ctx != null) {
			return ctx.getBean(beanName, clazz);
		}
		return null;
	}
}
